<?php

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Auth::routes();

Route::get('/questions', 'QuestionController@index')->name('questions.index');
Route::get('/questions/{question}', 'QuestionController@show')->name('questions.show');

Route::post('/questions/{question}/answers','AnswerController@store');

Route::post('/answers/{answer}/best','BestAnswersController@store')->name('best-answer.store');

Route::delete('/answers/{answer}','AnswerController@destroy')->name('answer.destroy');


Route::post('/answers/{answer}/up-votes', 'AnswerUpVotesController@store')->name('answer-up-votes.store');
Route::post('/answers/{answer}/down-votes', 'AnswerUpVotesController@destroy')->name('answer-down-votes.store');
